package com.wsz.utils;

import com.auth0.jwt.interfaces.DecodedJWT;

public class TokenUtils {

    public static final String getUserId(String token) throws  Exception{
        DecodedJWT decodedJWT = JwtUtils.parseToken(token);
        String userId = decodedJWT.getSubject();
        return userId;
    }

    public static final String getUsername(String token) throws Exception{
        DecodedJWT decodedJWT = JwtUtils.parseToken(token);
        String username = decodedJWT.getIssuer();
        return username;
    }
}
